package com.keyware.utils.keycloud;

public class LicenseVerify {

	/**
	 * 校验
	 * @param XMLPath 配置文件路径
	 * @param signPath 获取数字证书路径
	 * @param strPubKey 公钥
	 * @return
	 * @throws Exception
	 */
	public static boolean Verify(String XMLPath, String signPath,String strPubKey) throws Exception {
		//1.读取文件内容
		String XMLcontent = ReadFile.readFile(XMLPath,"UTF-8");
		//2.定义公钥
		//3.获取数字证书路径
		String signStr = ReadFile.readFile(signPath,"UTF-8");
		//4.数字签名验证，根据这三个就可以验证了（公钥，读取配置文件中的内容，数字签名）
		return SignProvider.verify(strPubKey.getBytes("UTF-8"), XMLcontent.getBytes("UTF-8"), signStr.getBytes("UTF-8"));
	}
	
}
